package com.dzx.swing;

import javax.swing.*;
import java.awt.*;

/**
 * @author dzx
 * @ClassName:
 * @Description:
 * @date 2019年07月25日 11:43:31
 */
public class BorderLayoutDemo extends JFrame {

    public BorderLayoutDemo() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setDefaultLookAndFeelDecorated(true);
        setLayout(new BorderLayout());
        setSize(400, 200);
        setTitle("java第三个GUI程序");

        JButton jButton1 = new JButton("上");
        JButton jButton2 = new JButton("左");
        JButton jButton3 = new JButton("中");
        JButton jButton4 = new JButton("右");
        JButton jButton5 = new JButton("下");

        add(jButton1, BorderLayout.NORTH);
        add(jButton2, BorderLayout.WEST);
        add(jButton3, BorderLayout.CENTER);
        add(jButton4, BorderLayout.EAST);
        add(jButton5, BorderLayout.SOUTH);

        setVisible(true);


    }

    public static void main(String[] args){
        new BorderLayoutDemo();
    }


}
